<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
   <jsp:useBean id="testbean" scope="session" class="dataconn.MyDbBean" />
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>学籍管理系统</title>
     </head>
   <%!	String url,sql; %>   
   <%! int i;%>
   <body bgcolor="#ffffff">
      <div align="center"><font color="#000000" size="5">学籍管理系统 </font> </div>
      <table width="75%" border="1" cellspacing="1" cellpadding="1" align="center">
      <tr>
         <td width=16% align=center>学号</td>
	     <td width=16% align=center>姓名</td>
	     <td width=8% align=center>性别</td>
	     <td width=8% align=center>年龄</td>
	    <td width=16% align=center>籍贯</td>
	    <td width=12% align=center>院系</td>
	    <td width=12% align=center>更改</td>
	    <td width=12% align=center>删除</td>
    </tr>
    <%
      //调用getConn方法与数据库建立连接
       testbean.getConn("Data_Stu", "sa","");
	   sql="select * from stuInfo";
	   ResultSet  rs=testbean.executeQuery1(sql);//查询数据库
	    while(rs.next()){
    %>
      <tr>
        <td width=16% align=center><%=rs.getString(1)%></td>
	    <td width=16% align=center><%=rs.getString(2)%></td>
	    <td width=8% align=center><%=rs.getString(3)%></td>
	    <td width=8% align=center><%=rs.getInt(4)%></td>
	    <td width=16% align=center><%=rs.getString(5)%></td>
	    <td width=12% align=center><%=rs.getString(6)%></td>
	    <td width=12% align=center><a href="change.jsp?xuehao=<%=rs.getString(1)%>">修改</a></td>
	    <td width=12% align=center><a href="del.jsp?xuehao=<%=rs.getString(1)%>">删除</a></td>
      </tr>
      <%
	   }
	    rs.close();
	    testbean.closeStmt();
	    testbean.closeConn();
    %>
	</table>
	<div align="center"><a href="insert.jsp">添加新记录 </a> </div>
	</body>
</html>